package com.alibaba.travel.common.exception;

/**
 * Created with IntelliJ IDEA.
 *
 * @Author: where
 * @Date: 2023/03/07/10:53
 * @Description: 异常处理枚举类
 */

public enum ExceptionEnum {
    // 数据操作错误定义
    BODY_NOT_MATCH(4000,"请求的数据格式不符!"),
    SIGNATURE_NOT_MATCH(4001,"请求的数字签名不匹配!"),
    NOT_FOUND(4004, "未找到该资源!"),
    INTERNAL_SERVER_ERROR(5000, "服务器内部错误!"),
    SERVER_BUSY(5003, "服务器正忙，请稍后再试!"),

    AUTHORIZATION_ERROR(5001, "该用户权限不够"),
    AUTHENTICATION_ERROR(5002, "用户验证失败");

    private int code;
    private String message;

    ExceptionEnum(int code, String message) {
        this.code = code;
        this.message = message;
    }

    public int getCode() {
        return code;
    }

    public String getMessage() {
        return message;
    }
}
